#include <iostream>
#include <sys/syslog.h>
#include "../client/TcpClient.h"

int main()
{
    // 打开日志，设置日志的标识（可选）
    openlog("client", LOG_CONS | LOG_PID | LOG_NDELAY, LOG_LOCAL1);

    // 记录信息日志
    std::cout << "Hello, World!" << std::endl;
    Client client("127.0.0.1", 11111);
    if (client.Connect()) {
        std::cout << "connect success!" << std::endl;
    }
    for (int i = 0; i < 10; i++) {
        std::string message = "message No: " + std::to_string(i);
        client.Send(message);
    }

    while(1) {
        sleep(0.01);
    }
    return 0;
}
